﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing;

namespace CodeEditorCompiler
{
    public static class RichTextBoxExtensions
    {
        public static void AppendText( this RichTextBox box, Color color, string text )
        {
            int start = box.TextLength;
            box.AppendText( text );
            int end = box.TextLength;

            box.Select( start, end - start );
            box.SelectionColor = color;
            box.SelectionLength = 0;
        }
    }
}
